package org.backend.controller;

import org.backend.pojo.entity.Admin;
import org.backend.pojo.entity.User;
import org.backend.service.AdminService;
import org.backend.utils.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    private AdminService adminService;

    @PostMapping("/login")
    public ApiResponse<Admin> login(@RequestBody Admin admin) {
        return adminService.login(admin);
    }

    @PostMapping("/getUserInfo")
    public ApiResponse<List<User>> getUserInfo(@RequestBody Admin admin) {
        return ApiResponse.error("接口还待修改");
    }
}
